<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:90:"D:\tool\wamp64\www\platform_ems\public/../application/admin\view\devicesoftware\index.html";i:1531272786;s:66:"D:\tool\wamp64\www\platform_ems\application\admin\view\layout.html";i:1531272786;s:73:"D:\tool\wamp64\www\platform_ems\application\admin\view\Layout\header.html";i:1531362950;s:73:"D:\tool\wamp64\www\platform_ems\application\admin\view\Layout\footer.html";i:1531272786;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>ems管理系统</title>

    <link href="/platform_ems/public/admin//css/style.default.css" rel="stylesheet">
    <link href="/platform_ems/public/admin//css/morris.css" rel="stylesheet">
    <link href="/platform_ems/public/admin//css/select2.css" rel="stylesheet" />
    <link href="/platform_ems/public/admin//css/colorpicker.css" rel="stylesheet" />
    <script src="/platform_ems/public/admin//js/jquery-1.11.1.min.js"></script>
    <script src="/platform_ems/public/admin//js/jquery-migrate-1.2.1.min.js"></script>
    <script src="/platform_ems/public/admin//js/bootstrap.min.js"></script>
    <script src="/platform_ems/public/admin//js/modernizr.min.js"></script>
    <script src="/platform_ems/public/admin//js/pace.min.js"></script>
    <script src="/platform_ems/public/admin//js/retina.min.js"></script>
    <script src="/platform_ems/public/admin//js/jquery.cookies.js"></script>

    <script src="/platform_ems/public/admin//js/jquery.dataTables.min.js"></script>
    <script src="http://cdn.datatables.net/plug-ins/725b2a2115b/integration/bootstrap/3/dataTables.bootstrap.js"></script>
    <script src="http://cdn.datatables.net/responsive/1.0.1/js/dataTables.responsive.js"></script>
    <script src="/platform_ems/public/admin//js/select2.min.js"></script>
    <script src="/platform_ems/public/admin//js/jquery.form.js"></script>
    <!--<script src="/platform_ems/public/admin//js/jquery.noty.js"></script>-->

    <script src="/platform_ems/public/admin//js/custom.js"></script>
    <script src="/platform_ems/public/admin//js/colorpicker.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="/platform_ems/public/admin//js/html5shiv.js"></script>
    <script src="/platform_ems/public/admin//js/respond.min.js"></script>
    <![endif]-->
    <style>
        .icon-default{
            color: #428bca;
        }
        .dataTable {
            text-align: center
        }

        .dataTable thead th{
            text-align: center
        }
    </style>

    <script>
        $(function () {
            // var munemakeurl = '/public/<?php echo request()->module(); ?>/<?php echo strtolower(request()->controller()); ?>/<?php echo request()->action(); ?>.html'
            var munemakeurl = '/ems_tp5_master/public/index.php/<?php echo request()->module(); ?>/<?php echo strtolower(request()->controller()); ?>/<?php echo request()->action(); ?>.html'

            // console.log(munemakeurl)
            mune_active_init(munemakeurl)
            function mune_active_init(munemakeurl) {

                var muneaobj =$("#mune_nav").find('a')
                var muneliobj =$("#mune_nav").children('li')
                $.each(muneliobj,function (i,v) {
                    v.className ='parent'
                })

                $.each(muneaobj,function (i,v) {
                    if(munemakeurl == v.getAttribute('href')){
                        v.parentNode.className ='active'
                        var code = v.parentNode.parentNode.parentNode
                        code.className ='active'
                        return;
                    }
                    // console.log(v.getAttribute('href'))
                })
                $("#mune_index_li").attr('class','')
            }
        })
    </script>
</head>

<body>




<header>
    <div class="headerwrapper">
        <div class="header-left">
            <a href="index.html" class="logo">
                <img src="/platform_ems/public/admin//images/logo.png" alt="" />
            </a>
            <div class="pull-right">
                <a href="" class="menu-collapse">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
        </div><!-- header-left -->

        <div class="header-right">

            <div class="pull-right">

                <form class="form form-search" action="search-results.html">
                    <input type="search" class="form-control" placeholder="Search" />
                </form>

                <div class="btn-group btn-group-list btn-group-notification" style="display: none">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-bell-o"></i>
                        <span class="badge">5</span>
                    </button>
                    <div class="dropdown-menu pull-right">
                        <a href="" class="link-right"><i class="fa fa-search"></i></a>
                        <h5>Notification</h5>
                        <ul class="media-list dropdown-list">
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user1.png" alt="">
                                <div class="media-body">
                                    <strong>Nusja Nawancali</strong> likes a photo of you
                                    <small class="date"><i class="fa fa-thumbs-up"></i> 15 minutes ago</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user2.png" alt="">
                                <div class="media-body">
                                    <strong>Weno Carasbong</strong> shared a photo of you in your <strong>Mobile Uploads</strong> album.
                                    <small class="date"><i class="fa fa-calendar"></i> July 04, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user3.png" alt="">
                                <div class="media-body">
                                    <strong>Venro Leonga</strong> likes a photo of you
                                    <small class="date"><i class="fa fa-thumbs-up"></i> July 03, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user4.png" alt="">
                                <div class="media-body">
                                    <strong>Nanterey Reslaba</strong> shared a photo of you in your <strong>Mobile Uploads</strong> album.
                                    <small class="date"><i class="fa fa-calendar"></i> July 03, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user1.png" alt="">
                                <div class="media-body">
                                    <strong>Nusja Nawancali</strong> shared a photo of you in your <strong>Mobile Uploads</strong> album.
                                    <small class="date"><i class="fa fa-calendar"></i> July 02, 2014</small>
                                </div>
                            </li>
                        </ul>
                        <div class="dropdown-footer text-center">
                            <a href="" class="link">See All Notifications</a>
                        </div>
                    </div><!-- dropdown-menu -->
                </div><!-- btn-group -->

                <div class="btn-group btn-group-list btn-group-messages" style="display: none">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-envelope-o"></i>
                        <span class="badge">2</span>
                    </button>
                    <div class="dropdown-menu pull-right">
                        <a href="" class="link-right"><i class="fa fa-plus"></i></a>
                        <h5>New Messages</h5>
                        <ul class="media-list dropdown-list">
                            <li class="media">
                                <span class="badge badge-success">New</span>
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user1.png" alt="">
                                <div class="media-body">
                                    <strong>Nusja Nawancali</strong>
                                    <p>Hi! How are you?...</p>
                                    <small class="date"><i class="fa fa-clock-o"></i> 15 minutes ago</small>
                                </div>
                            </li>
                            <li class="media">
                                <span class="badge badge-success">New</span>
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user2.png" alt="">
                                <div class="media-body">
                                    <strong>Weno Carasbong</strong>
                                    <p>Lorem ipsum dolor sit amet...</p>
                                    <small class="date"><i class="fa fa-clock-o"></i> July 04, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user3.png" alt="">
                                <div class="media-body">
                                    <strong>Venro Leonga</strong>
                                    <p>Do you have the time to listen to me...</p>
                                    <small class="date"><i class="fa fa-clock-o"></i> July 03, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user4.png" alt="">
                                <div class="media-body">
                                    <strong>Nanterey Reslaba</strong>
                                    <p>It might seem crazy what I'm about to say...</p>
                                    <small class="date"><i class="fa fa-clock-o"></i> July 03, 2014</small>
                                </div>
                            </li>
                            <li class="media">
                                <img class="img-circle pull-left noti-thumb" src="/platform_ems/public/admin//images/photos/user1.png" alt="">
                                <div class="media-body">
                                    <strong>Nusja Nawancali</strong>
                                    <p>Hey I just met you and this is crazy...</p>
                                    <small class="date"><i class="fa fa-clock-o"></i> July 02, 2014</small>
                                </div>
                            </li>
                        </ul>
                        <div class="dropdown-footer text-center">
                            <a href="" class="link">See All Messages</a>
                        </div>
                    </div><!-- dropdown-menu -->
                </div><!-- btn-group -->

                <div class="btn-group btn-group-option">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-caret-down"></i>
                    </button>
                    <ul class="dropdown-menu pull-right" role="menu">
                       <!-- <li><a href="#"><i class="glyphicon glyphicon-user"></i> My Profile</a></li>
                        <li><a href="#"><i class="glyphicon glyphicon-star"></i> Activity Log</a></li>
                        <li><a href="#"><i class="glyphicon glyphicon-cog"></i> Account Settings</a></li>
                        <li><a href="#"><i class="glyphicon glyphicon-question-sign"></i> Help</a></li>
                        <li class="divider"></li>-->
                        <li><a href="<?php echo url('admin/Publics/loginout'); ?>"><i class="glyphicon glyphicon-log-out"></i>Sign Out</a></li>
                    </ul>
                </div><!-- btn-group -->

            </div><!-- pull-right -->

        </div><!-- header-right -->

    </div><!-- headerwrapper -->
</header>

<section>
    <div class="mainwrapper">
        <div class="leftpanel">
            <div class="media profile-left">
                <a class="pull-left profile-thumb" href="profile.html">
                    <img class="img-circle" src="/platform_ems/public/admin//images/photos/profile.png" alt="">
                </a>
                <div class="media-body">
                    <h4 class="media-heading"><?php echo \think\Session::get('user_name'); ?></h4>
                    <small class="text-muted">Beach Lover</small>
                </div>
            </div><!-- media -->

            <h5 class="leftpanel-title">Navigation</h5>
            <ul id="mune_nav" class="nav nav-pills nav-stacked">

                <li id="mune_index_li" class="">
                    <a href="<?php echo url('admin/index/index','id=5&name=thinkphp'); ?>"><i class="fa fa-home"></i> <span>首页</span></a>
                </li>
                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>机构管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/org/index'); ?>">机构管理</a></li>
                    </ul>
                </li>

                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>用户管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/user/index'); ?>">用户管理</a></li>
                    </ul>
                </li>

                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>设备管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/device/index'); ?>">设备管理</a></li>
                    </ul>
                </li>
                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>会员管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/customer/index'); ?>">会员管理</a></li>
                    </ul>
                </li>

                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>设备账号管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/padaccount/index'); ?>">账号管理</a></li>
                    </ul>
                </li>

                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>升级服务管理</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/Devicesoftware/index'); ?>">设备升级服务管理</a></li>
                        <li><a href="<?php echo url('admin/Padsoftware/index'); ?>">pad升级服务管理</a></li>
                    </ul>
                </li>
                <!--统计-->
                <li class="parent">
                    <a href=""><span class="glyphicon glyphicon-folder-close icon-default"></span> <span>数据统计</span></a>
                    <ul class="children">
                        <li><a href="<?php echo url('admin/Datacount/padacclog'); ?>">账户在线日志统计</a></li>
                        <li><a href="<?php echo url('admin/Datacount/devicelog'); ?>">设备状态统计</a></li>
                    </ul>
                </li>



            </ul>

        </div><!-- leftpanel -->
<link href="/platform_ems/public/admin//css/style.default.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="/platform_ems/public/admin//js/html5shiv.js"></script>
<script src="/platform_ems/public/admin//js/respond.min.js"></script>
<![endif]-->
<style>
    .param_div .form-control{
        padding: 5px;
    }

    .param_div .param_lable{
        padding-top: 5px;
        padding-left: 0px;
    }

</style>
<div class="mainpanel">
    <div class="pageheader">
        <div class="media">
            <div class="pageicon pull-left">
                <i class="fa fa-th-list"></i>
            </div>
            <div class="media-body">
                <ul class="breadcrumb">
                    <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
                    <li><a href="">首页</a></li>
                    <li>版本管理</li>
                </ul>
                <h4>版本管理</h4>
            </div>
        </div><!-- media -->
    </div>

    <div class="contentpanel">

        <div class="panel panel-primary-head">
            <div id="succ_file_s" class="alert alert-success hides">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <strong>版本添加成功</strong>
            </div>

            <div id="faild_file_s" class="alert alert-danger hides">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <strong>版本添加失败,请检查！</strong>
            </div>

            <div class="row" style="padding: 0 15px">


            </div>

            <div class="row">
                <div class="col-md-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-btns" style="display: none;">
                                <a href="" class="panel-minimize tooltips maximize" data-toggle="tooltip" title="" data-original-title="Minimize Panel">
                                    <i class="fa fa-plus"></i>
                                </a>
                            </div><!-- panel-btns -->
                            <h4 class="panel-title">添加版本</h4>
                            <p style="    color: #fff;">点击右上角显示更多</p>
                        </div><!-- panel-heading -->
                        <div class="panel-body" style="display: none;">
                            <form id="user_add_ajaxForm" method="post" action="<?php echo url('admin/devicesoftware/add'); ?>" enctype="multipart/form-data">
                                
                                <div class="row">
                                    <div class="form-group col-md-4">
                                        <label>版本名</label>
                                        <input type="text" name="name" placeholder="版本名" class="form-control">
                                    </div>

                                    <div class="form-group col-md-4" >
                                        <label>类型</label>
                                        <input  name="dev_type" placeholder="类型" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4" >
                                        <label>软件版本</label>
                                        <input  name="dev_edition" placeholder="软件版本" class="form-control">
                                    </div>

                                </div>
                                <div class="row">
                                    <div class="form-group col-md-12" >
                                        <label>描述</label>
                                    <textarea name="desc" class="form-control"></textarea>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-md-4" >
                                        <label>选择文件</label>
                                        <input id="dev_soft_file_add" type="file" name="filecontent" class="hides" style="display: none">
                                        <button type="button"  name="dev_edition" placeholder="选择文件"
                                                onclick="$('#dev_soft_file_add').click()"
                                                class="btn btn-primary form-control">选择文件</button>
                                    </div>

                                </div><!-- row -->
                            </form>

                        </div><!-- panel-body -->

                        <div class="panel-footer" style="display: none;">
                            <button id="USER_ADD_FROM_BTN" class="btn btn-primary">添加</button>
                        </div><!-- panel-footer -->
                    </div><!-- panel -->

                </div>
            </div>
            <!--查询条件-->
            <div class="row param_div hides">
                <div class="col-md-3">
                    <div class="col-md-4 param_lable">
                        <label>创建开始时间：</label>
                    </div>
                    <div class="col-md-8 param_input">
                        <input name="begin_createtime"  class="form-control">
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="col-md-4 param_lable">
                        <label>创建结束时间：</label>
                    </div>
                    <div class="col-md-8 param_input">
                        <input name="end_createtime"  class="form-control">
                    </div>
                </div>
                <div class="col-md-3">
                    <button class="btn btn-primary btn-sm">查询</button>
                </div>
            </div>

            <table id="exRowTable" class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>版本名</th>
                    <th>版本</th>
                    <th>创建时间</th>
                    <th>类型</th>
                    <th>文件名</th>
                    <th>描述</th>
                    <th>操作</th>
                </tr>
                </thead>
            </table>
        </div><!-- panel -->

    </div>

</div>
<!--madol 修改密码 hide-->
<div id="user_paw_save_madol" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">&times;</button>
                <h4 class="modal-title"><span id="username_save"></span>修改密码</h4>
            </div>
            <div class="modal-body">
                <div id="user_paw_save_param" class="row" style="padding-right: 2rem;padding-left: 2rem">
                    <div class="row">
                        <label>原密码</label>
                        <input type="password" name="ipwd"  class="form-control">
                        <input id="username_param" type="hidden" name="username_param">
                    </div>
                    <div class="row">
                        <label>新密码</label>
                        <input type="password" name="npwd"  class="form-control">
                    </div>
                    <div class="row">
                        <label>重复新密码</label>
                        <input type="password" name="renpwd"  class="form-control">
                    </div>
                    <div class="row" style="padding-right: 1rem;padding-top: 1rem" >
                        <button style="float: right;" id="USER_PWD_EDIT_FROM_BTN" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .hides{
        display: none;
    }

</style>
<script>
    jQuery('#select-search-hide').select2({
        minimumResultsForSearch: -1
    });
    var exRowTable;
    $(function(){

        var role_mark = <?php echo \think\Session::get('user.user_role'); ?>;

        $('#user_add_ajaxForm [name="user_role"]').val(role_mark+1)

        $("#USER_MADOL_ADD_BTN").click(function () {
            $("#user_add_madol").modal("show")
        })
        // 添加版本
        $("#USER_ADD_FROM_BTN").click(function () {

            var user_name = $("#user_add_ajaxForm").find('[name = "name"]').val()
            var user_paw = $("#user_add_ajaxForm").find('[name = "acc_pwd"]').val()
            var re_acc_pwd = $("#user_add_ajaxForm").find('[name = "re_acc_pwd"]').val()
            // 账号
            if(user_name == null || user_name == undefined || user_name == ''){
                $("#user_add_ajaxForm").find('[name = "acc_name"]').focus()
                alert("版本名不能为空")
                return;
            }
            // return;
            $("#user_add_ajaxForm").ajaxSubmit(function (data) {
                console.log(data)
                if(data == 1){
                    $(".hides").hide()
                    $("#faild_file_s").html('版本添加失败')
                    $("#faild_file_s").show()
                }else{
                    $(".hides").hide()
                    $("#succ_file_s").html('版本添加成功')
                    $("#succ_file_s").show()
                }
                exRowTable.ajax.reload();
            });


        })
        // 修改版本
        $("#USER_PWD_EDIT_FROM_BTN").click(function () {
            var ipwd = $("#user_paw_save_param").find('[name = "ipwd"]').val()
            var npwd = $("#user_paw_save_param").find('[name = "npwd"]').val()
            var renpwd = $("#user_paw_save_param").find('[name = "renpwd"]').val()
            var acc_name = $("#user_paw_save_param").find('[name = "username_param"]').val()

            if(npwd == renpwd){
                $.post("<?php echo url('admin/user/userupd'); ?>",{acc_pwd:npwd,acc_name:acc_name},function (data) {
                    if(data == 1){
                        alert('修改成功')
                    }else{
                        alert("修改失败")
                    }
                })
            }else{
                alert("新密码两次不一致！请检查")
            }
        })

        $("[data-toggle='tooltip']").tooltip();




        exRowTable = $('#exRowTable').DataTable({
            responsive: true,
            "fnDrawCallback": function(oSettings) {
                jQuery('#exRowTable_paginate ul').addClass('pagination-active-success');
            },
            "ajax": "<?php echo url('admin/devicesoftware/query'); ?>",
            "columns": [
                { "data": "id" },
                { "data": "name" },
                { "data": "dev_edition" },
                { "data": "create_time" },
                { "data": "dev_type" },
                { "data": "file_name" },
                { "data": "desc" },
                { "data": "id","render": function ( data, type, full, meta ) {
                        return '<button onclick="user_del('+data+')" class="btn btn-danger btn-xs">删除</button>';
                    }},
            ],
            "order": [[0, 'desc']]
        });




    })
    // 删除版本
    function user_del(id) {
        if(confirm('确认删除！')){
            $.post("<?php echo url('admin/devicesoftware/del'); ?>",{ID:id},function (data) {
                if(data == 1){
                    exRowTable.ajax.reload();
                    alert('删除成功')
                    // console.log('删除成功')
                }else{
                    alert("该版本不能删除")
                }
                exRowTable.ajax.reload();
            })
        }
    }

    function user_paw_save_view(id,acc_name) {
        $("#username_save").html(acc_name)
        $("#username_param").val(acc_name)
        $("#user_paw_save_madol").modal('show')
    }


</script>




</div><!-- mainwrapper -->
</section>





</body>
</html>